$(function(){
    $('#btnxj').click(function(){
        window.location.href="/user/createindex";

    })
    $('#btnqx').click(function(){
        window.location.href="/user/index";
    })
    $('#btnbc').click(function(){
    console.log('1');
    let id = $('[name=id]').val();
    let name = $('[name=name]').val();
    let isbn = $('[name=isbn]').val();
        let obj={
            id,
            bookName:name,
            isbn

        }
        $.post('/user/save',obj,function(){
            window.location.href="/user/index";
        })
    })
    $('#btncz').click(function(){
    console.log('1');
        let name = $('[name=text]').val();
        window.location.href=`/user/index/${name}`
    })
})

function btnbj(id)
{
    console.log('1');
    window.location.href=`/user/createindex/${id}`;
}
function btnsc(id)
{
    console.log('1');
    let msg = "确认删除？";
    if (confirm(msg)) {
        window.location.href=`/user/delete/${id}`;
    }
   

}